<template>
  <div class="wrapper">
    <swiper ref="mySwiper" :options="swiperOptions">
      <swiper-slide
        v-for= "item of swiperList"
        :key="item.id"
      >
        <img class="swiper-img" :src="item.imgUrl" alt="">
      </swiper-slide>
      <div class="swiper-pagination" slot="pagination"></div>
    </swiper>
  </div>
</template>

<script>
export default {
  name: 'HomeSwiper',
  data () {
    return {
      swiperOptions: {
        pagination: '.swiper-pagination',
        // 无接缝轮播
        loop: true,
        autoplay: false
      },
      swiperList: [{
        id: '001',
        imgUrl: 'https://images.blogchina.com/v5_ogc/60e3b4dda77b61625535709.jpg'
      }, {
        id: '002',
        imgUrl: 'https://images.blogchina.com/v5_ogc/60e3b4dda77b61625535709.jpg'
      }]
    }
  }
}
</script>

<style scoped lang="stylus">
  .wrapper >>>.swiper-pagination-bullet-active
    background: #fff
  .wrapper
    //%44.4 高/宽
    overflow :hidden
    width :100%
    height :0
    padding-bottom :44.44%
    background :#eee
    .swiper-img
      width :100%
</style>
